﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UI_weijielaidian : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string phone = FTchina.basic.SafeRequest(Request["phone"]);
        if (phone.Length > 0)
        {

            //取5分钟内的电话
            string testsql = "select   *  from callin_log where strftime('%s','now','localtime') -strftime('%s',calltime) <180  and callnum='" + phone + "'";
            if (!FTchina.shujuku.testread(testsql))
            {//没有记录就插入一个未接来电，有记录就等待jietinglaidian.aspx更新成已接听
                FTchina.Models.Callin_Log mCallin_Log = new FTchina.Models.Callin_Log();
                mCallin_Log.Id = 0;
                mCallin_Log.Callnum = phone;
                mCallin_Log.Calltime = Convert.ToDateTime(FTchina.basic.GetSqliteDate());
                mCallin_Log.State = "0";
                FTchina.BLL.Callin_LogManager.AddCallin_Log(mCallin_Log);
            }
        }
    }
}